home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1146
/
1146.xpi
/
chrome
/
screengrab.jar
/
content
/
Clipboard.js
< prev
next >
Wrap
Text File
|
2009-03-09
|
950b
|
26 lines
screengrab.Clipboard = {
putImgDataUrl : function(dataUrl, callbackWhenDone) {
var image = window.content.document.createElement("img");
image.setAttribute("style", "display: none");
image.setAttribute("id", "screengrab_buffer");
image.setAttribute("src", dataUrl);
var body = window.content.document.getElementsByTagName("html")[0];
body.appendChild(image);
setTimeout(this.copyImage(image, body, document, callbackWhenDone), 200);
},
copyImage : function(image, body, documenty, callbackWhenDone) {
return function () {
documenty.popupNode = image;
try {
goDoCommand('cmd_copyImageContents');
} catch (ex) {
alert(ex);
}
body.removeChild(image);
if (callbackWhenDone) {
callbackWhenDone();
}
};
}
}